#!/usr/bin/env bash

############################################################################
#
# 远程执行该脚本，请在命令行中直接执行以下命令：
#
#   curl -sSL https://gitee.com/tay3223/biubiubiu/raw/master/init-debian-buster.sh | /bin/bash
#
#
############################################################################



#更换国内加速源
tee /etc/apt/sources.list << Tay

deb http://mirrors.163.com/debian/ buster main non-free contrib
# deb-src http://mirrors.163.com/debian/ buster main non-free contrib

deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
# deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib

deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
# deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib

deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
# deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

Tay



#更新源依赖
apt update



#安装常用软件
apt install -y vim \
    sudo \
    curl \
    wget \
    bash-completion


#清华源速度秒杀163源，但是它不支持http默认就是https
tee /etc/apt/sources.list << Tay

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

Tay




#封装常用命令
cat << Tay >> /root/.bashrc


#自定义命令
alias ll="ls -alh"

#登录时重新加载/etc/profile
. /etc/profile
Tay



#设置vim常用配置
cat << Tay > /root/.vimrc
"设置一个tab等于4个空格
set ts=4

"输入tab时，自动将其转化为空格
set expandtab

"语法高亮度显示
syntax on

"确保UTF-8编码
set encoding=utf-8

"苹果电脑在vim中删除键不管用，需要设置这个属性
set backspace=2
Tay


cat << EOF

提示：

curl -sSL https://gitee.com/tay3223/biubiubiu/raw/master/debian-buster-init.sh | /bin/bash

初始化脚本运行完成，需要重新进入终端才能生效...

EOF
